import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        // 默认显示的页面
        redirect: '/login'
    },
    {
        path: '/login',
        name: '登录页面',
        component: () => import('@/views/login/login.vue')
    },
    {
        path: "/layout",
        name: "首页",
        component: () => import('@/views/layout/layout.vue'),
        children: [{
            path: '/userManage',
            name: '角色管理',
            component: () => import('@/views/userManage/userManage.vue')
        },
        {
            path: '/userAhthor',
            name: '角色授权',
            component: () => import('@/views/userAuthor/userAuthor.vue')
        },
        {
            path: '/finance',
            name: '财务',
            component: () => import('@/views/finance/finance.vue')
        },
        {
            path: '/hospital',
            name: '医院管理',
            component: () => import('@/views/hospital/hospital.vue')
        },
        {
            path: '/peopleManage',
            name: '人员管理',
            component: () => import('@/views/peopleManage/peopleManage.vue')
        },
        {
            path: '/department',
            name: '科室管理',
            component: () => import('@/views/department/department.vue')
        },
        {
            path: '/warehouse',
            name: '仓库管理',
            component: () => import('@/views/warehouse/warehouse.vue')
        }
        ]
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
